$("#apple_id").focusin(function(){
    $(this).siblings(".hide-placeholder-name-1").css({
        "left":"15px",
        "top":"25px",
        "font-size":"12px"
    });
})

$("#apple_id").focusout(function(){
    if($(this)[0].value===''){
        $(this).siblings(".hide-placeholder-name-1").css({
            "left":"15px",
            "top":"50%",
            "font-size":"18px"
        });
    }
    if($(this)[0].value!==''){
        $(this).siblings(".hide-placeholder-name-1").css({
            "left":"15px",
            "top":"25px",
            "font-size":"12px"
        });
    }
})

$("#apple_psw").focusin(function(){
    $(this).siblings(".hide-placeholder-name-1").css({
        "left":"15px",
        "top":"25px",
        "font-size":"12px"
    });
})

$("#apple_psw").focusout(function(){
    if($(this)[0].value===''){
        $(this).siblings(".hide-placeholder-name-1").css({
            "left":"15px",
            "top":"50%",
            "font-size":"18px"
        });
    }
    if($(this)[0].value!==''){
        $(this).siblings(".hide-placeholder-name-1").css({
            "left":"15px",
            "top":"25px",
            "font-size":"12px"
        });
    }
})

let apple_id = document.querySelector('#apple_id');
let apple_psw = document.querySelector('#apple_psw');
let warning_id = document.querySelector('.warning-apple-id');
let warning_psw = document.querySelector('.warning-apple-psw');
let login_form = document.querySelector('#login-form');
apple_id.addEventListener('blur',checkId);
function checkId(){
    console.log(apple_id.value.length);
    if(apple_id.value===''||apple_id.value.length<6){
        warning_id.style.visibility = 'visible';
        apple_id.style.background = '#fef0f0';
    }else {
        warning_id.style.visibility = 'hidden';
        apple_id.style.background = '#fffef2';
    }
};
apple_psw.addEventListener('blur',checkPsw);
function checkPsw(){
    console.log(apple_psw.value.length);
    if(apple_psw.value===''||apple_psw.value.length<6){
        warning_psw.style.visibility = 'visible';
        apple_psw.style.background = '#fef0f0';
    }else {
        warning_psw.style.visibility = 'hidden';
        apple_psw.style.background = '#fffef2';
    }
}

let btn = document.querySelector('#login_btn');
console.log(btn);
btn.addEventListener('click',function(){
    checkId();
    checkPsw(apple_psw);
    if((warning_id.style.visibility==='hidden') && (warning_psw.style.visibility==='hidden')){
        login_form.submit();
    }
})
